home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
ARSRC21.ZIP
/
AR256H2.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-02
|
40KB
|
1,289 lines
// class for game messages
// requires vars defined after main bunch of includes
extern int bigtile(int,int,unsigned char far *,char,char);
extern int memerror();
extern char mygetch();
extern int cycleballs();
//extern void downbip(int);
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include "ar256h.cpp"
#include "ar256def.h"
#include "ar256ex.h"
extern mouse m;
screenmsgs::screenmsgs()
{
FILE *in;int i;
printf("Checking screen...\n");
logsp=(char *)malloc(0x400);
loga=(char *)malloc(0x400);
logb=(char *)malloc(0x400);
if((logsp==NULL)||(loga==NULL)||(logb==NULL))memerror();
in=fopen("loga.dat","rb");
for (i=0;i<0x400;++i)
{
fscanf(in,"%c",&loga[i]);
}
fclose(in);
in=fopen("logb.dat","rb");
for (i=0;i<0x400;++i)
{
fscanf(in,"%c",&logb[i]);
}
fclose(in);
in=fopen("spells.dat","rb");
for (i=0;i<0x400;++i)
{
fscanf(in,"%c",&logsp[i]);
}
fclose(in);
}
screenmsgs::~screenmsgs()
{
free(logsp);free(loga);free(logb);
}
void screenmsgs::usespace(void)
{
setcolor(0x07);setfillstyle(1,0);
bar(190,310,330,322);
rectangle(190,310,330,322);
outtextxy(195,312,"Press space...");
}
void screenmsgs::usemouse(void)
{
m.bitmapoff();
setcolor(0x07);setfillstyle(1,0);
bar(190,260,300,292);
rectangle(190,260,300,292);
outtextxy(200,262,"Use the mouse to");
outtextxy(200,272,"highlight squares;");
outtextxy(200,282,"Space to select one.");
m.bitmapon(cursor,pcol[curpla]);
}
void screenmsgs::usekeys(void)
{
setcolor(0x07);setfillstyle(1,0);
bar(200,305,335,327);
rectangle(200,305,335,327);
outtextxy(210,307,"Use keypad to");
outtextxy(210,317,"select a square.");
}
void screenmsgs::plecho(unsigned char)
{
int x=486,y=100;
setfillstyle(0,0);
bar (x,y,x+80,y+10);
setcolor(pcol[curpla]);
outtextxy(x,y,pname[curpla]);
}
void screenmsgs::mecho(unsigned char,unsigned char)
{
char outbuf[3];
int x=486,y=200;
setfillstyle(0,0);
bar (x,y,x+150,y+50);
setcolor(0x07);
outtextxy(x,y,mon[curpla][curmon].name);
outtextxy(x,y+10,"Attack strength: ");
outtextxy(x+130,y+10,itoa(mon[curpla][curmon].attack,outbuf,10));
outtextxy(x,y+20,"Defend strength: ");
outtextxy(x+130,y+20,itoa(mon[curpla][curmon].defend,outbuf,10));
if (mon[curpla][curmon].mshots)
{
setcolor(0x07);
outtextxy(x+58,y+30,"Range: ");
outtextxy(x+112,y+30,itoa(mon[curpla][curmon].range,outbuf,10));
outtextxy(x+120,y+30,"x");
outtextxy(x+128,y+30,itoa(mon[curpla][curmon].mshots,outbuf,10));
}
if ((mon[curpla][curmon].id>=0x80)&&(mon[curpla][curmon].id!=0xff))
{
setcolor(0x08);
outtextxy(x,y+30,"(undead)");
}
if (mon[curpla][curmon].fly)
{
setcolor(0x03);
outtextxy(x,y+40,"(flying)");
}
if (mon[curpla][curmon].spellnum)
{
setcolor(0x05);
outtextxy(x+70,y+40,"(magical)");
}
}
void screenmsgs::fecho(monster attacker,monster defender,char win)
{
int x=486,y=300;
setfillstyle(0,0);
bar (x,y,x+149,y+50);
setcolor(pcol[attacker.whatside]);
outtextxy(x,y,attacker.name);
setcolor(0x07);
outtextxy(x,y+10,attacker.atmes);
setcolor(pcol[defender.whatside]);
outtextxy(x,y+20,defender.name);
if (win==1)//if attack fails
{
setcolor(0x07);
outtextxy(x,y+30,attacker.defmes);
}
if (win==0)//if it succeeds
{
setcolor(0x04);
outtextxy(x,y+30,attacker.diemes);
}
if (win==2)//if corpse
{
setcolor(0x05);
outtextxy(x,y+30,"but a little late...");
}
if (win==3)//if undead
{
setcolor(0x0a);
outtextxy(x,y+30,"who's already died...");
}
}
void screenmsgs::shecho(monster attacker,monster defender,char win,char kind)
{
int x=486,y=300;
setfillstyle(0,0);
bar (x,y,x+149,y+50);
setcolor(pcol[attacker.whatside]);
outtextxy(x,y,attacker.name);
setcolor(0x07);
if(strlen(attacker.shotmes)>2) //in case something that cant usually fire does fire
outtextxy(x,y+10,attacker.shotmes);
else
outtextxy(x,y+10,"shoots at");
setcolor(pcol[defender.whatside]);
outtextxy(x,y+20,defender.name);
if (win==0)//if tree
{
setcolor(0x07);
outtextxy(x,y+30,"but hits a tree.");
}
if (win==1)//if miss
{
setcolor(0x05);
outtextxy(x,y+30,"who dodges.");
}
if (win==2)//if hit
{
setcolor(0x04);
switch (kind)
{
case 0:
outtextxy(x,y+30,"and grins nastily.");break;
case 1:
outtextxy(x,y+30,"transfixing it.");break;
case 2:
outtextxy(x,y+30,"frying it's brain.");break;
case 3:
outtextxy(x,y+30,"disintegrating it!");break;
}
}
}
void screenmsgs::modecho(int mode)
{
int x=485,y=120;
char buf[3];
setfillstyle(0,0);
bar(x,y,x+88,y+9);
setcolor(0x0d);
switch (mode){
case 1: outtextxy(x,y,"MOVES:");outtextxy(x+54,y,itoa(moves,buf,10));break;
case 2: outtextxy(x,y,"FLIGHT:");outtextxy(x+64,y,itoa(moves,buf,10));break;
case 3: setcolor(0x0f);outtextxy(x,y,"NEXT PIECE");break;
case 4: setcolor(0x0c);outtextxy(x,y,"AIMING");break;
case 5: outtextxy(x,y,"NEW TURN");break;
}
}
void screenmsgs::recho(char sqx,char sqy)
{
char outbuf[3];
int x=486,y=400;
setfillstyle(0,0);
bar(x,y,x+151,y+75);
setcolor(0x0e);
rectangle(482,397,638,479);//recho
setcolor(0x0c);
outtextxy(x,y,"Square: ");
outtextxy(x+64,y,itoa(sqx,outbuf,10));
outtextxy(x+88,y,itoa(sqy,outbuf,10));
if (sq[sqx][sqy].land==1)
{
setcolor(0x02);outtextxy(x,y+10,"Trees of");
setcolor(pcol[sq[sqx][sqy].whose]);
outtextxy(x+72,y+10,pname[sq[sqx][sqy].whose]);
}
if (sq[sqx][sqy].land==3){setcolor(0x06);outtextxy(x,y+10,"A stump");}
if (sq[sqx][sqy].land==4){setcolor(0x06);outtextxy(x,y+10,"A crater");}
if (sq[sqx][sqy].land==5){setcolor(0x08);outtextxy(x,y+10,"Mirkwoods");}
if (sq[sqx][sqy].land==6){setcolor(0x0a);outtextxy(x,y+10,"Tall grass");}
if (sq[sqx][sqy].land==7){setcolor(0x04);outtextxy(x,y+10,"Raging fires");}
if (sq[sqx][sqy].land==8){setcolor(0x0c);outtextxy(x,y+10,"Tall flames");}
if (sq[sqx][sqy].land==2){setcolor(0x04);outtextxy(x,y+10,"Wall");}
if (sq[sqx][sqy].land>=10){setcolor(0x07);outtextxy(x,y+10,"An Orb of");
setcolor(pcol[sq[sqx][sqy].whose]);
outtextxy(x+80,y+10,pname[sq[sqx][sqy].whose]);}
if (sq[sqx][sqy].whatside==0xff){return;}
else// if creature
{
if (mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].status==0x11)
{ //if corpse
setcolor(0x08);
outtextxy(x,y+20,"The shade of a");
outtextxy(x,y+30,mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].name);
return;
}
if (sq[sqx][sqy].whatmonster==0)//if wizard
{
setcolor(pcol[sq[sqx][sqy].whatside]);
outtextxy(x,y+20,pname[sq[sqx][sqy].whatside]);
outtextxy(x,y+30,"himself.");
}
else
{
setcolor(0x07);
outtextxy(x,y+20,mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].name);
outtextxy(x,y+30,"loyal to");
setcolor(pcol[sq[sqx][sqy].whatside]);
outtextxy(x,y+40,pname[sq[sqx][sqy].whatside]);
}
if ((mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].id>=0x80)&&
(mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].id!=0xff))
{ //dont use status of illusions too obvious
setcolor(0x08);outtextxy(x,y+50,"(undead)");
}
if (mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].fly)
{
setcolor(0x03);outtextxy(x,y+60,"(flying)");
}
if (mon[sq[sqx][sqy].whatside][sq[sqx][sqy].whatmonster].spellnum)
{
setcolor(0x05);outtextxy(x+70,y+60,"(magical)");
}
}
}
void screenmsgs::trecho(monster attacker,char chopped)
{
int x=486,y=300;
setfillstyle(0,0);
bar (x,y,x+149,y+50);
setcolor(pcol[attacker.whatside]);
outtextxy(x,y,attacker.name);
if(!chopped)
{
outtextxy(x,y+10,"fails hopelessly");
outtextxy(x,y+20,"to hit even a tree!");
}
else
{
setcolor(0x02);outtextxy(x,y+10,"hacks up the tree");
outtextxy(x,y+20,"and looks smug.");
}
}
void screenmsgs::boxes(void)
{
int i;
setcolor(0x0f);
setfillstyle(1,0);
bar(481,75,640,480);
//rectangle(481,0,639,479);
setcolor(0x0c);
outtextxy(482,87,"Player and mode:");
outtextxy(482,187,"This creature:");
outtextxy(482,287,"Combat:");
outtextxy(482,387,"Looking at:");
setcolor(0x0d);
bar(483,97,580,111);//plecho
bar(483,197,637,252);//mecho
bar(483,297,636,351);//fecho
bar(483,117,580,131);//modecho
bar(483,397,637,479);//recho
rectangle(482,97,585,112);//plecho
rectangle(482,197,637,253);//mecho
rectangle(482,297,637,352);//fecho
rectangle(482,117,585,132);//modecho
rectangle(482,397,637,479);//recho
}
extern void yinyang(int,int,int,signed int);
void screenmsgs::spells(monster thismonster)
{
int i=0;char outbuf[20];
char textcolor;
setfillstyle(1,20);
bar(482,0,640,480);
bigtile(500,-20,logsp,2,0);
setcolor(0);setfillstyle(1,0);
fillellipse(600,30,29,29);
yinyang(600,30,25,alignment[curpla]);
//settextstyle(0,0,3);outtextxy(498,10,"ARENA");settextstyle(0,0,2);
setcolor(0x1e);
outtextxy(482,70,pname[curpla]);
//outtextxy(482,70,"Spells:");
settextstyle(0,0,1);setcolor(0x1c);
while(i<thismonster.spellnum)
{
strcpy(outbuf,spellname(thismonster.spells[i],&textcolor));
setcolor(textcolor);
outtextxy(482,95+i*10,outbuf);
//bip(thismonster.spells[i]/5);delay(10);
++i;
}
}
void screenmsgs::logo(void)
{
//char loga[0x400],logb[0x400];
setfillstyle(1,0);bar(481,0,640,75);
bigtile(490,10,loga,2,0);bigtile(554,10,logb,2,0);
}
void screenmsgs::decho(char curpla)
{
int i,j,px,py;
m.bitmapoff();
deathwindow(120,140,370,245,1);
for (i=0;i<0x400;++i)
{
px=130+(i % 32);py=150+(i / 32);
if (tile[mon[curpla][0].graphic][i]<0xfe) putpixel(px,py,tile[mon[curpla][0].graphic][i]);
if (tile[mon[curpla][0].graphic][i] == 0xfe)putpixel(px,py,pcol[curpla]);//print col of player
}
settextstyle(0,0,3);setcolor(pcol[curpla]);
outtextxy(165,160,pname[curpla]);
setcolor(0x07);
settextstyle(0,0,1);
if (kills[curpla]<4)
{
outtextxy(130,190,"has met a horrible end!");
outtextxy(130,200,"He is sadly mourned by his");
outtextxy(130,210,"devoted family and friends.");
outtextxy(130,220,"Wherever he is, everyone");
outtextxy(130,230,"hopes he is happy. *sniff*");
}
else
{
outtextxy(130,190,"has met his just desserts!");
outtextxy(130,200,"Everyone in the arena dances");
outtextxy(130,210,"on his grave. There is a big");
outtextxy(130,220,"party! Wherever he is, it's");
outtextxy(130,230,"probably really, really hot...");
}
downbip(3);
mygetch();
m.bitmapon(cursor,pcol[curpla]);
}
void screenmsgs::deathwindow(int ax,int ay, int bx, int by,int size)
{
FILE *in;int px,py,middle,i;
unsigned char death[0x1000];
in=fopen("death.dat","rb");
for(i=0;i<0x1000;++i)
{
fscanf(in,"%c",&death[i]);
}
setfillstyle(1,0);setcolor(0x0f);
bar(ax,ay,bx,by);
rectangle(ax,ay,bx,by);
middle=(ax+bx)/2;
for(i=0;i<0x1000;i++)
{
px=middle-(32*size)+(i%0x40)*size;py=ay-(38*size)+(i/0x40)*size;
if(death[i]<240)
{
setfillstyle(1,death[i]);
bar(px,py,px+size-1,py+size-1);
}
if(death[i]==248)
{
setfillstyle(1,247+curpla);
bar(px,py,px+size-1,py+size-1);
}
}
}
void screenmsgs::help()
{
setfillstyle(1,0);setcolor(0x07);
m.bitmapoff();
bar(150,100,330,400);
rectangle(150,100,330,400);
bigtile(174,110,loga,2,0);bigtile(238,110,logb,2,0);
setcolor(0x0f);
outtextxy(160,180,"Moving:");setcolor(0x07);
outtextxy(160,190," Cast spells: s");
outtextxy(160,200," Fire: f");
outtextxy(160,210," Next: <space>");
outtextxy(160,220," Fly: t");
outtextxy(160,230," Quit: Q");
outtextxy(160,240," Quit fast: !");
outtextxy(160,250," Move: keypad");
outtextxy(160,260," Move map: mouse");setcolor(0x0f);
outtextxy(160,280,"Aiming:");setcolor(0x07);
outtextxy(160,290," Move map: click");
outtextxy(160,300," Select: <space>");setcolor(0x0f);
outtextxy(160,320,"Spells:");setcolor(0x07);
outtextxy(160,330," Real: lclick");
outtextxy(160,340," Illusion: rclick");
outtextxy(160,350," Help: <space>");
outtextxy(160,370,"Press something to");
outtextxy(160,380,"return to the game.");
mygetch();
m.bitmapon(cursor,pcol[curpla]);
}
char * screenmsgs::spellname(int spell,char * spellcol)
{
char evil=0x40;
char yellow=0x44;
char green=0x48;
char good=0x4c;
switch (spell)
{
case 1: *spellcol=(yellow);
return("Fireball LR");
case 0: *spellcol=(0x50);
return("...");
case 2: *spellcol=(yellow);
return("Chaos --");
case 3: *spellcol=(yellow);
return("Magic arrow LR");
case 4: *spellcol=(yellow);
return("Psionic ray LR");
case 5: *spellcol=(green);
return("Strength --");
case 6: *spellcol=(green);
return("Heroism --");
case 7: *spellcol=(green);
return("Raise dead --");
case 8: *spellcol=(green);
return("Create forest --");
case 9: *spellcol=(green);
return("Create trees LR");
case 10: *spellcol=(green);
return("Create walls LR");
case 11: *spellcol=(yellow);
return("Blast --");
case 12: *spellcol=(green);
return("Charm L-");
case 13: *spellcol=(green);
return("Reincarnate --");
case 14: *spellcol=(yellow);
return("Weakness --");
case 15: *spellcol=(green);
return("Haste --");
case 16: *spellcol=(green);
return("Fly --");
case 17: *spellcol=(green);
return("Shield --");
case 18: *spellcol=(yellow);
return("Swarm -S");
case 19: *spellcol=(yellow);
return("Mana storm -S");
case 20: *spellcol=(yellow);
return("Shockwave -R");
case 21: *spellcol=(green);
return("Clone --");
case 22: *spellcol=(yellow);
return("Earthquake -R");
case 23: *spellcol=(green);
return("Create grass LR");
case 24: *spellcol=(green);
return("Polymorph self -S");
case 25: *spellcol=(yellow);
return("Create mirkwood LR");
case 26: *spellcol=(green);
return("Gift --");
case 27: *spellcol=(green);
return("Teleport L-");
case 28: *spellcol=(0x04);
return("Curse --");
case 29: *spellcol=(0x0f);
return("Bless --");
case 30: *spellcol=0x0b;
return("Mirror 0");
case 31: *spellcol=(evil);
return("Call a beholder 4");
case 32: *spellcol=(good);
return("Call a retainer 0");
case 33: *spellcol=(evil);
return("Call a skeleton 2");
case 34: *spellcol=(evil);
return("Call a bat 2");
case 35: *spellcol=(good);
return("Call an archer 0");
case 36: *spellcol=(evil);
return("Call a goblin 1");
case 37: *spellcol=(evil);
return("Call red dragon 6");
case 38: *spellcol=(evil);
return("Call a spectre 3");
case 39: *spellcol=(evil);
return("Call a lich 6");
case 40: *spellcol=(evil);
return("Call a ghost 3");
case 41: *spellcol=(good);
return("Call gold dragon 7");
case 42: *spellcol=(good);
return("Call minions 0");
case 43: *spellcol=(green);
return("Summon 0");
case 44: *spellcol=(good);
return("Summon a nema 0");
case 45: *spellcol=(good);
return("Call a lion 4");
case 46: *spellcol=(good);
return("Call a brownie 1");
case 47: *spellcol=(good);
return("Call a sidhe 3");
case 48: *spellcol=(good);
return("Call a hound 0");
case 49: *spellcol=(evil);
return("Call a wolf 3");
case 50: *spellcol=(green);
return("Call something 3");
case 51: *spellcol=(good);
return("Call a gryphon 6");
case 52: *spellcol=(evil);
return("Call a manticore 5");
case 53: *spellcol=(good);
return("Call a centaur 5");
case 54: *spellcol=(good);
return("Call an eagle 4");
case 55: *spellcol=(good);
return("Call a giant 4");
case 56: *spellcol=(good);
return("Call salamander 5");
case 57: *spellcol=(evil);
return("Call a zombie 1");
case 58: *spellcol=(evil);
return("Call a hydra 4");
case 98: *spellcol=0x38;
return("The nema spell! ");
case 99: *spellcol=78;
return("True Sight "); //6 spaces and 2 tabs to make infinity sign...
default:
return("*shrug*");
}
}
void screenmsgs::spellhelp(int which)
{
char colour;char outbuf[30];unsigned long test;
setcolor(0x0f);setfillstyle(1,0);
bar(150,80,330,320);
rectangle(150,80,330,320);
bigtile(174,90,loga,2,0);bigtile(238,90,logb,2,0);
outtextxy(160,170,"Help on:");
strcpy(outbuf,spellname(which,&colour));
setcolor(colour);
outtextxy(160,180,outbuf);
switch(which)
{
case 1:outtextxy(160,200,"This spell casts a");
outtextxy(160,210,"powerful missile");
outtextxy(160,220,"with range about 6");
outtextxy(160,230,"squares. It can set");
outtextxy(160,240,"fire to the ground");
outtextxy(160,250,"and destroy shades.");
break;
case 2:outtextxy(160,200,"Chaos is dangerous");
outtextxy(160,210,"and unpredictable.");
outtextxy(160,220,"Use only in times");
outtextxy(160,230,"of desperation.");
break;
case 3:outtextxy(160,200,"This spell casts a");
outtextxy(160,210,"weak projectile.");
break;
case 4:outtextxy(160,200,"This spell casts a");
outtextxy(160,210,"medium-strength");
outtextxy(160,220,"beam of something");
outtextxy(160,230,"destructive.");
break;
case 5:outtextxy(160,200,"This spell makes");
outtextxy(160,210,"whatever it is cast");
outtextxy(160,220,"on a little better");
outtextxy(160,230,"at attacking and");
outtextxy(160,240,"defending itself.");
break;
case 6:outtextxy(160,200,"Want a HERO on your");
outtextxy(160,210,"side? This spell");
outtextxy(160,220,"makes whatever it is");
outtextxy(160,230,"cast on into a ");
outtextxy(160,240,"fighter of HEROIC");
outtextxy(160,250,"abilities.");
break;
case 7:outtextxy(160,200,"This spell brings a");
outtextxy(160,210,"shade back to life.");
outtextxy(160,220,"The shade will not");
outtextxy(160,230,"necessarily be very");
outtextxy(160,240,"grateful... so aim");
outtextxy(160,250,"at one of your own.");
break;
case 8:outtextxy(160,200,"Making forests is");
outtextxy(160,210,"good -- that's why");
outtextxy(160,220,"this spell makes your");
outtextxy(160,230,"alignment better as");
outtextxy(160,240,"well as surrounding");
outtextxy(160,250,"the target square");
outtextxy(160,260,"with trees.");
break;
case 9:outtextxy(160,200,"This allows you to");
outtextxy(160,210,"create a few trees");
outtextxy(160,220,"on any square you can");
outtextxy(160,230,"see. It also makes");
outtextxy(160,240,"your alignment");
outtextxy(160,250,"better.");
break;
case 10:outtextxy(160,200,"Being shot at? Use");
outtextxy(160,210,"this to create walls");
outtextxy(160,220,"between you and them!");
break;
case 11:outtextxy(160,200,"This spell BLASTS");
outtextxy(160,210,"the contents of one");
outtextxy(160,220,"square. It is not");
outtextxy(160,230,"very accurate :)");
break;
case 12:outtextxy(160,200,"This spell can");
outtextxy(160,210,"make an enemy");
outtextxy(160,220,"monster change sides.");
outtextxy(160,230,"As the little 'L'");
outtextxy(160,240,"after it suggests,");
outtextxy(160,250,"though, you have to");
outtextxy(160,260,"be able to see the");
outtextxy(160,270,"target to use it.");
break;
case 13:outtextxy(160,200,"Reincarnation");
outtextxy(160,210,"may bring back one");
outtextxy(160,220,"of your vanished");
outtextxy(160,230,"monsters -- even if");
outtextxy(160,240,"it was an illusion.");
break;
case 14:outtextxy(160,200,"This spell makes");
outtextxy(160,210,"whatever it is cast");
outtextxy(160,220,"on a little worse");
outtextxy(160,230,"at attacking and");
outtextxy(160,240,"defending itself.");
break;
case 15:outtextxy(160,200,"This useful spell");
outtextxy(160,210,"doubles the speed");
outtextxy(160,220,"of whatever it is");
outtextxy(160,230,"cast on. VERY nice");
outtextxy(160,240,"if used on an eagle.");
break;
case 16:outtextxy(160,200,"This spell gives a");
outtextxy(160,210,"monster the ability");
outtextxy(160,220,"to fly, oddly enough.");
break;
case 17:outtextxy(160,200,"Protect your front-");
outtextxy(160,210,"line units with this");
outtextxy(160,220,"Shield! It makes ");
outtextxy(160,230,"whoever gets it DIE");
outtextxy(160,240,"less often!");
break;
case 18:outtextxy(160,200,"A close-in defence");
outtextxy(160,210,"spell. Don't rely");
outtextxy(160,220,"on it -- it hardly");
outtextxy(160,230,"ever kills anything");
outtextxy(160,240,"tougher than a ");
outtextxy(160,250,"brownie.");
break;
case 19:outtextxy(160,200,"Brought to you from");
outtextxy(160,210,"the game ANGBAND,");
outtextxy(160,220,"this thing is deadly.");
outtextxy(160,230,"Kills all non-wizzes");
outtextxy(160,240,"indiscriminately.");
break;
case 20:outtextxy(160,200,"Destroys everything");
outtextxy(160,210,"in a line between ");
outtextxy(160,220,"caster and target. ");
outtextxy(160,230,"Use when they're all");
outtextxy(160,240,"lined up neatly.");
break;
case 21:outtextxy(160,200,"Makes you a clone of");
outtextxy(160,210,"a monster, yours or");
outtextxy(160,220,"the enemy's. A clone");
outtextxy(160,230,"is always real. So");
outtextxy(160,240,"don't make illusory");
outtextxy(160,250,"dragons while your");
outtextxy(160,260,"enemy has this ");
outtextxy(160,270,"spell... unless of");
outtextxy(160,280,"course you can charm");
outtextxy(160,290,"it back...");
break;
case 22:outtextxy(160,200,"Devastating. Ices");
outtextxy(160,210,"all trees etc and");
outtextxy(160,220,"most monsters near");
outtextxy(160,230,"where it's cast.");
outtextxy(160,240,"Short range, though.");
outtextxy(160,260,"Like all special");
outtextxy(160,270,"attacks, it won't get");
outtextxy(160,280,"wizards and orbs.");
break;
case 23:outtextxy(160,200,"This allows you to");
outtextxy(160,210,"create some grass");
outtextxy(160,220,"on any square you can");
outtextxy(160,230,"see, thus slowing");
outtextxy(160,240,"movement down.");
break;
case 24:outtextxy(160,200,"This one's obvious.");
outtextxy(160,210,"WARNING -- it's very");
outtextxy(160,220,"unlikely that you'll");
outtextxy(160,230,"polymorph into a wiz,");
outtextxy(160,240,"so you might lose all ");
outtextxy(160,250,"remaining spells.");
break;
case 25:outtextxy(160,200,"Make your alignment");
outtextxy(160,210,"more evil by creating");
outtextxy(160,220,"vicious mirkwoods to");
outtextxy(160,230,"consume your foes!");
break;
case 26:outtextxy(160,200,"This spell will ");
outtextxy(160,210,"ask you to choose a");
outtextxy(160,220,"second spell, then");
outtextxy(160,230,"to choose who to give");
outtextxy(160,240,"that spell to. The");
outtextxy(160,250,"spell is copied ");
outtextxy(160,260,"rather than moved.");
break;
case 27:outtextxy(160,200,"This spell will ask");
outtextxy(160,210,"you to choose a ");
outtextxy(160,220,"monster and then a ");
outtextxy(160,230,"square. You must be");
outtextxy(160,240,"in sight of the ");
outtextxy(160,250,"monster; the square");
outtextxy(160,260,"can be anywhere.");
outtextxy(160,270,"You can't teleport ");
outtextxy(160,280,"enemy wizards.");
break;
case 28:outtextxy(160,200,"Like 'Blast', but");
outtextxy(160,210,"only works on good");
outtextxy(160,220,"monsters and trees.");
outtextxy(160,230,"Inaccurate.");
break;
case 29:outtextxy(160,200,"Like 'Blast' but");
outtextxy(160,210,"only works on evil");
outtextxy(160,220,"things and mirkwoods.");
outtextxy(160,230,"Inaccurate.");
break;
case 30:outtextxy(160,200,"Makes a duplicate");
outtextxy(160,210,"of yourself, with");
outtextxy(160,220,"different spells.");
outtextxy(160,230,"The duplicate isn't");
outtextxy(160,240,"real, and thus tends");
outtextxy(160,250,"not to last long.");
break;
case 31:outtextxy(160,200,"Slow, puny and poss-");
outtextxy(160,210,"essing a nasty beam");
outtextxy(160,220,"attack, the beholder");
outtextxy(160,230,"is ideal defensive");
outtextxy(160,240,"artillery. Hide it");
outtextxy(160,250,"in a tree for best");
outtextxy(160,260,"results.");
break;
case 32:outtextxy(160,200,"Retainers are so");
outtextxy(160,210,"loyal, they always");
outtextxy(160,220,"come to you. Their");
outtextxy(160,230,"abilities are, well,");
outtextxy(160,240,"er... sort of");
outtextxy(160,250,"averageish.");
break;
case 33:outtextxy(160,200,"Skeletons? Slow.");
outtextxy(160,210,"Weak. Socially un-");
outtextxy(160,220,"successful. But");
outtextxy(160,230,"undead and therefore");
outtextxy(160,240,"unhittable by regular");
outtextxy(160,250,"attacks.");
break;
case 99:outtextxy(160,200,"This spell will");
outtextxy(160,210,"destroy any illusory");
outtextxy(160,220,"monster. This ");
outtextxy(160,230,"includes ones");
outtextxy(160,240,"created by the");
outtextxy(160,250,"mirror spell.");
break;
case 98:outtextxy(160,200,"The tea spell will");
outtextxy(160,210,"double the powers");
outtextxy(160,220,"of whatever it");
outtextxy(160,230,"is cast upon, but");
outtextxy(160,240,"it only has a range");
outtextxy(160,250,"of one square.");
break;
case 58:outtextxy(160,200,"This will create");
outtextxy(160,210,"a massive hydra.");
outtextxy(160,220,"These lumbering ");
outtextxy(160,230,"monsters are slow");
outtextxy(160,240,"but difficult to");
outtextxy(160,250,"kill even with the");
outtextxy(160,260,"most powerful");
outtextxy(160,270,"magic.");
break;
case 57:outtextxy(160,200,"Just like in the");
outtextxy(160,210,"movies, but now");
outtextxy(160,220,"reduced to a 32x32");
outtextxy(160,230,"tile. Although");
outtextxy(160,240,"slow and feeble, it");
outtextxy(160,250,"is immune to normal");
outtextxy(160,260,"attacks.");
break;
case 56:outtextxy(160,200,"This spell creates");
outtextxy(160,210,"a fiery salamander");
outtextxy(160,220,"These elemental");
outtextxy(160,230,"creatures come");
outtextxy(160,240,"with three free");
outtextxy(160,250,"fireball spells.");
outtextxy(160,260,"Kind of like a poor");
outtextxy(160,270,"man's dragon.");
break;
case 55:outtextxy(160,200,"This spell brings");
outtextxy(160,210,"a mighty giant to");
outtextxy(160,220,"aid your armies.");
outtextxy(160,230,"Giants attack with");
outtextxy(160,240,"mighty strength");
outtextxy(160,250,"and are not easily");
outtextxy(160,260,"destroyed.");
break;
case 54:outtextxy(160,200,"This spell creates");
outtextxy(160,210,"a noble eagle. ");
outtextxy(160,220,"These creatures are");
outtextxy(160,230,"fast and fierce,");
outtextxy(160,240,"but are easily ");
outtextxy(160,250,"killed if they stray");
outtextxy(160,260,"within range of an");
outtextxy(160,270,"enemy.");
break;
case 53:outtextxy(160,200,"The centaur is");
outtextxy(160,210,"an ancient half man");
outtextxy(160,220,"half horse. A good");
outtextxy(160,230,"allrounder, able to");
outtextxy(160,240,"fire arrows once per");
outtextxy(160,250,"turn. With its good");
outtextxy(160,260,"speed and formidable");
outtextxy(160,270,"hooves it is much");
outtextxy(160,280,"more use than a human");
outtextxy(160,290,"archer.");
break;
case 52:outtextxy(160,200,"The vile manticore");
outtextxy(160,210,"is an evil monster");
outtextxy(160,220,"able to fire spikes");
outtextxy(160,230,"from its tail, in");
outtextxy(160,240,"addition to a fairly");
outtextxy(160,250,"powerful bite.");
break;
case 51:outtextxy(160,200,"The fearsome");
outtextxy(160,210,"Gryphon is second");
outtextxy(160,220,"only to the dragons.");
outtextxy(160,230,"It can deliver");
outtextxy(160,240,"a ferocious ");
outtextxy(160,250,"attack from the air.");
break;
case 50:outtextxy(160,200,"An unpredictable");
outtextxy(160,210,"spell that creates");
outtextxy(160,220,"a hideous mutant.");
outtextxy(160,230,"It's powers are");
outtextxy(160,240,"random, and it ");
outtextxy(160,250,"may be magical;");
outtextxy(160,260,"then again it's");
outtextxy(160,270,"often useless.");
break;
case 49:outtextxy(160,200,"This spell gives");
outtextxy(160,210,"you command of an");
outtextxy(160,220,"evil wolf. With a");
outtextxy(160,230,"fair range, these");
outtextxy(160,240,"are a good addition");
outtextxy(160,250,"to any army.");
break;
case 48:outtextxy(160,200,"While not as");
outtextxy(160,210,"powerful as the");
outtextxy(160,220,"wolf, these hounds");
outtextxy(160,230,"are loyal and the");
outtextxy(160,240,"spell cannot fail");
outtextxy(160,250,"to call one.");
break;
case 47:outtextxy(160,200,"This spell creates");
outtextxy(160,210,"a small magical");
outtextxy(160,220,"creature. It's");
outtextxy(160,230,"like a brownie,");
outtextxy(160,240,"only useful.");
outtextxy(160,260,"Without its magic");
outtextxy(160,270,"the Sidhe is mere");
outtextxy(160,280,"dragon fodder.");
break;
case 46:outtextxy(160,200,"How pathetic! This");
outtextxy(160,210,"spell calls a worth-");
outtextxy(160,220,"less brownie, the");
outtextxy(160,230,"most hopeless thing");
outtextxy(160,240,"in the arena. It");
outtextxy(160,250,"might block a few ");
outtextxy(160,260,"arrows before it");
outtextxy(160,270,"dies.");
break;
case 45:outtextxy(160,200,"Fast and strong,");
outtextxy(160,210,"a lion will get the");
outtextxy(160,220,"better of many");
outtextxy(160,230,"creatures. Lions");
outtextxy(160,240,"are photogenic");
outtextxy(160,250,"and thus have a");
outtextxy(160,260,"good alignment.");
break;
case 44:outtextxy(160,200,"This spell creates");
outtextxy(160,210,"a Nema! The Nema");
outtextxy(160,220,"will appear anywhere");
outtextxy(160,230,"in the arena. It");
outtextxy(160,240,"is a strange little");
outtextxy(160,250,"creature, useful");
outtextxy(160,260,"only for it's one");
outtextxy(160,270,"powerful spell.");
outtextxy(160,280,"After casting it's");
outtextxy(160,290,"spell it vanishes.");
break;
case 43:outtextxy(160,200,"This spell randomly");
outtextxy(160,210,"calls zero to three");
outtextxy(160,220,"monsters, which");
outtextxy(160,230,"always appear and");
outtextxy(160,240,"are always real.");
outtextxy(160,250,"No dragons are");
outtextxy(160,260,"allowed, though.");
break;
case 42:outtextxy(160,200,"Calls for aid from");
outtextxy(160,210,"your loyal retainers");
outtextxy(160,220,"and archers. ");
outtextxy(160,250,"This spell will");
outtextxy(160,260,"make your alignment");
outtextxy(160,270,"much more better.");
break;
case 41:outtextxy(160,200,"If this spell");
outtextxy(160,210,"works you will call");
outtextxy(160,220,"forth the mightiest");
outtextxy(160,230,"of all beasts. With");
outtextxy(160,240,"up to two fireballs");
outtextxy(160,250,"a round and spells,");
outtextxy(160,260,"gold dragons are the");
outtextxy(160,270,"most powerful things");
outtextxy(160,280,"in the arena.");
break;
case 40:outtextxy(160,200,"Scared? Neither");
outtextxy(160,210,"will the enemy be.");
outtextxy(160,220,"However ghosts are");
outtextxy(160,230,"pretty fast and can");
outtextxy(160,240,"fly, and like all");
outtextxy(160,250,"undead cannot be hit");
outtextxy(160,260,"by the living.");
break;
case 39:outtextxy(160,200,"Most lethal of the");
outtextxy(160,210,"undead, liches can");
outtextxy(160,220,"direct their evil");
outtextxy(160,230,"in a beam that des-");
outtextxy(160,240,"troys enemies... ");
outtextxy(160,250,"they also know the");
outtextxy(160,260,"occasional spell.");
outtextxy(160,270,"Nice to have.");
break;
case 38:outtextxy(160,200,"Stronger than a ");
outtextxy(160,210,"ghost but slower,");
outtextxy(160,220,"the spectre is a");
outtextxy(160,230,"medium-strength");
outtextxy(160,240,"undead.");
break;
case 37:outtextxy(160,200,"This spell will");
outtextxy(160,210,"try and call a");
outtextxy(160,220,"fire breathing red");
outtextxy(160,230,"dragon, second most");
outtextxy(160,240,"powerful thing in ");
outtextxy(160,250,"the arena. Evil,");
outtextxy(160,260,"airborne, strong and");
outtextxy(160,270,"devilishly handsome.");
outtextxy(160,280,"Use a heroism spell");
outtextxy(160,290,"on it for added");
outtextxy(160,300,"kill-power.");
break;
case 36:outtextxy(160,200,"Not very strong,");
outtextxy(160,210,"but not as naff");
outtextxy(160,220,"as a brownie. They");
outtextxy(160,230,"die easily, but");
outtextxy(160,240,"people hardly ever");
outtextxy(160,250,"feel especially");
outtextxy(160,260,"sad about it.");
break;
case 35:outtextxy(160,200,"Surprisingly deadly,");
outtextxy(160,210,"archers can fire");
outtextxy(160,220,"twice in a round.");
outtextxy(160,230,"They have very long");
outtextxy(160,240,"range too. Even a");
outtextxy(160,250,"dragon won't live");
outtextxy(160,260,"long with a few of");
outtextxy(160,270,"these hidden in the");
outtextxy(160,280,"trees around it.");
break;
case 34:outtextxy(160,200,"Easy to scoff at,");
outtextxy(160,210,"the bat is fast and");
outtextxy(160,220,"able to fly, but");
outtextxy(160,230,"feeble. After a");
outtextxy(160,240,"few strength spells,");
outtextxy(160,250,"though, they get kind");
outtextxy(160,260,"of dangerous.");
}
mygetch();
drawmap(curx,cury);
}
void screenmsgs::graph(int history[4][50],char * label, char * label2)
{
char buf[3];
int i,j,num=0,current_x,lastx,lasty;
float yscale,xscale;
deathwindow(50,100,590,430,2);
setcolor(0x07);
outtextxy(70,110,"Here's how Death");
outtextxy(70,120,label);
outtextxy(70,130,label2);
outtextxy(60,150,"P");
outtextxy(60,160,"O");
outtextxy(60,170,"W");
outtextxy(60,180,"E");
outtextxy(60,190,"R");
outtextxy(480,398,"T U R N");
line(80,150,80,380);line(80,380,550,380);
xscale=(float)520/(float)thisturn;
for(i=1;i<thisturn-1;++i)
{
setcolor(0x03);
if((i%5==0)||(thisturn<20)) //if lots of turns print only every 5
{
outtextxy(80+(i*xscale),386,itoa(i,buf,10));
}
}
for(i=0;i<players;++i)
{
for(j=0;j<thisturn;++j)
{ //find highest ever strength
if(history[i][j]>num)num=history[i][j];
}
}
yscale=(float)250/(float)num;
if(yscale>1)yscale=1;//no point scaling it up if all the players were
//wimps
for(i=0;i<players;++i)
{
setcolor(pcol[i]);
//moveto(70,380-strength_history[i][0]*yscale);
current_x=80;lastx=80;lasty=380-history[i][0];
for(j=1;j<thisturn;++j)
{
lastx=current_x;
line(lastx,lasty,current_x+xscale,380-history[i][j]*yscale);
current_x+=xscale;
lasty=380-history[i][j]*yscale;
}
}
mygetch();
}
void screenmsgs::bargraph(int numbers[4],char * label,char * label2)
{
int i,xscale;
deathwindow(50,100,590,430,2);
setcolor(0x07);
outtextxy(70,110,"Here's how Death");
outtextxy(70,120,label);
outtextxy(70,130,label2);
outtextxy(60,150,"P");
outtextxy(60,160,"L");
outtextxy(60,170,"U");
outtextxy(60,180,"S");
outtextxy(60,280,"M");
outtextxy(60,290,"I");
outtextxy(60,300,"N");
outtextxy(60,310,"U");
outtextxy(60,320,"S");
outtextxy(440,256,"P L A Y E R");
line(80,150,80,380);
xscale=470/(players*2);
for(i=0;i<players;++i)
{
setfillstyle(1,pcol[i]); //add random number; otherwise graph is too boring.
bar(80+xscale*(i+1),250-(numbers[i]*10)+random(20)-10,80+xscale*(i+2),250);
}
line(80,250,550,250); //draws it afterward to conceal neutral bars.
mygetch();
}